<?php
/**
 * @desc :Created by PhpStorm.
 * @author : Baoshi <120907037@qq.com>
 * @since: 2018/7/24 19:52
 */
namespace app\common\designpattern\push;

/**
 * 推送 工厂类
 */
//简单工厂
class PushFactory {

   public static function setPush($type) {
          $result = null;
          switch ($type) {

          	case 'Jpush'://极光推送
          		$result = new Jpush();
          		break;
          	case 'AliPush'://阿里云 推送
          		$result = new AliPush();
          		break;
          	default:
			  	$result = new AliPush();
          		break;

          }

          return $result;
   }
}